package com.reason.user.feign;


import com.reason.common.pojo.Result;
import com.reason.user.pojo.Customer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *
 * @author zhouxiaoyu
 */
@FeignClient("user")
public interface CustomerFeign {

    /**
     * 查询用户信息的feign接口
     *
     * @param username
     * @return
     */
    @RequestMapping("/customer/find/{username}")
    public Customer findbyName(@PathVariable("username") String username);

    @RequestMapping("/customer/findAll")
    List<Customer> findAll();


    /**
     * 根据电话号码获取用户信息
     */
    @RequestMapping("/customer/findByTelephone/{telephone}")
    public Customer findByTelephone(@PathVariable("telephone") Long telephone);
    /**
     * 根据id获取用户信息
     */
    @GetMapping("/customer/findById/{Id}")
    public Result<Customer> findById(@PathVariable("Id") Long Id);



    /**
     * 注册用户成为一级用户（意思就是只是手机号登陆，其他信息都没有的状态）
     * @param customer
     */
    @PostMapping("/customer/register")
    public void register(@RequestBody Customer customer);

    /**
     * 注册成为二级会员(意思就是添加必须要填的资料)
     * @return
     */
    @RequestMapping("/customer/registerSeniorMember")
    public Result<Customer> registerSeniorMember(@RequestBody Customer customer);

    @RequestMapping("/update/member")
    public Result<Customer> updateMember(@RequestParam String userId, @RequestParam String membership_level);

}
